<?php $this->import('Header'); ?>
<div class="btn-toolbar">
	<a href="javascript:;" onclick="history.go(-1);" class="btn">返回</a>
</div>
<div class="well">
	<div class="tab-content">
		<div class="tab-pane active in">
			<div id="message-box"></div>
			<form method="post">
				<input name="id" type="hidden" value="<?php echo !empty($category['CategoryId']) ? $category['CategoryId'] : '' ?>" />
				<label style="">上级分类</label>
				<select name="pid" id="js-category" style="">
					<option value="0">根分类</option>
				</select>
				<label>分类名称</label>
				<input type="text" name="name" value="<?php echo !empty($category['CategoryName']) ? $category['CategoryName'] : '' ?>" class="input-xlarge">
				<label>排序</label>
				<input type="text" name="sort" value="<?php echo isset($category['Sort']) ? $category['Sort'] : '' ?>" class="input-xlarge">
				<div class="btn-toolbar">
					<button class="btn btn-primary"><i class="icon-save"></i> 保存</button>
				</div>
			</form>
		</div>
	</div>
</div>
<script>
	$('#js-category').category({
		pid:<?php echo !empty($category['Pid']) ? $category['Pid'] : 0 ?>,
		currentId:<?php echo !empty($category['CategoryId']) ? $category['CategoryId'] : 0 ?>,
		data: <?php echo json_encode($all) ?>
	});
</script>
<?php $this->import('Footer'); ?>